home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Music / PLAY / Play16 / Play16.doc < prev    next >
Text File  |  1995-06-22  |  21KB  |  499 lines

  1.  
  2. ---------------------------------------------------------------------------
  3. -- Play16 version 1.4 (22.06.95) - a versatile soundplayer for the Amiga --
  4. ---------------------------------------------------------------------------
  5.  
  6. Features in brief
  7. -----------------
  8.  - autodetects and plays several soundfiles, up to 16 bit / 56 kHz / stereo
  9.  - full Workbench support (but not Intuition and no GUI)
  10.  - always correct playback speed, even for sounds >28 kHz
  11.  - realtime playback from harddisk, optimized assembler routines
  12.  - optional 14 bit output (less noise but not as good as true 16 bit)
  13.  - automatic or manual audio filter control
  14.  - plays mono sounds on *both* channels, not only on the left one
  15.  - plays (and loops) files that are larger than memory
  16.  - preloading for exactly timed start of playback
  17.  - fast uLaw decompression
  18.  - system friendly audio channel allocation
  19.  - optionally dump the output into a file (can be used to convert sounds)
  20.  - supported Filetypes are:
  21.  
  22.    * Microsoft RIFF-WAVE  (.WAV)  mono / stereo, 8 / 16 bit, linear / uLaw
  23.    * Creative Voice File  (.VOC)  mono / stereo, 8 / 16 bit, linear
  24.    * Sun/NeXT Audio       (.AU)   mono / stereo, 8 / 16 bit, linear / uLaw
  25.    * MacroSystem MAUD     (.MAUD) mono / stereo, 8 / 16 bit, linear
  26.    * Apple/SGI/Amiga AIFF (.AIFF) mono / stereo, 8 / 16 bit, linear
  27.    * Amiga IFF-8SVX       (.IFF)  mono / stereo, 8      bit, linear
  28.    * Any raw sound data as long as it matches one of the following:
  29.      -  8 bit signed
  30.      -  8 bit unsigned
  31.      - 16 bit signed, Intel format    (LSB first)
  32.      - 16 bit signed, Motorola format (MSB first)
  33.  
  34.     - supported output devices are:
  35.  
  36.    * Native Amiga chipset (Paula)  8 bit
  37.    * Native Amiga chipset (Paula) 14 bit
  38.    * Native Amiga chipset (Paula) 14 bit calibrated (Christian Buchner)
  39.    * MacroSystem Maestro Pro      16 bit 44.1kHz and 48kHz only
  40.    * IFF-8SVX file dump            8 bit
  41.  
  42. ========================== Section 1: Quick start =========================
  43.  
  44. What do I need to use Play16?
  45. -----------------------------
  46. Any Amiga running Kickstart/Workbench 2.04 or greater.
  47.  
  48. To use the calibrated 14 bit output you need a valid CyberSound preferences
  49. file in your ENVARC: directory. If you don't have one already it can be
  50. generated with Christian's calibration package included in this distribution.
  51.  
  52. Maestix.library V38 or higher is required to use the MPro board for output.
  53.  
  54. Where do I find the latest version?
  55. -----------------------------------
  56.  - FIDONET: Amiga Venture BBS, Germany (2:243/6050)
  57.  - AMINET:  mus/play
  58.  - WWW:     http://linux.rz.fh-hannover.de/~wenzel/Play16/
  59.  
  60. further I recommend to have a look at the following packages:
  61.  
  62. CyberSound:
  63.  - AMINET:  disk/cdrom/14Bit_CDPlayer.lha
  64.  
  65. Maestix:
  66.  - AMINET:  util/libs/Maestix38_00.lha
  67.  
  68. How do I use it?
  69. ----------------
  70. From CLI:       Simply type "Play16 <filename>" and that's it!
  71. From Workbench: Just doubleclick on it's icon. A filerequester will pop up.
  72.  
  73. All possible options will be explained later. If you set none of them, the
  74. defaults will be used.
  75.  
  76.  
  77. ==================== Section 2: Background information ====================
  78.  
  79. What does it do?
  80. ----------------
  81. Basically, Play16 is capable of playing uncompressed and _some_ compressed
  82. soundfiles through Amiga's standard audio device or an increasing number of
  83. alternative devices. If the actual resolution or playback rate exceeds that
  84. of the Amiga hardware, realtime conversion is done so that the sound is
  85. being played back correctly.
  86.  
  87. You can even play 16 bit / 44.1 kHz sounds, providing all parts of
  88. your system can keep up with the high data transfer rate and lots
  89. of calculations needed for this task. (In this case an accelerated
  90. Amiga is recommended :-)
  91.  
  92. The two audio channels at each side can be linked to perform as a single
  93. 14 bit channel. Again, this swallows lots of computing power.
  94.  
  95. Anyway, my Amiga 3000-16MHz is fast enough to play an uncompressed soundfile
  96. with full 44.1kHz/14bit output (productivity) directly from harddisk !!!
  97.  
  98. I don't want Play16 to be a program that plays each and every exotic format
  99. that exists somewhere. However, I intend to support as many popular file
  100. types as possible.
  101.  
  102.  
  103. Why Play16?
  104. -----------
  105. 16 bit soundcards are becoming more and more popular, especially on the
  106. PC. The common file format over there is Microsoft's (yuck! :)) RIFF-
  107. WAVE format.
  108. I didn't find any CLI based program to play back 16 bit recordings, on a
  109. standard Amiga, so I decided to write one myself.
  110.  
  111.  
  112. Why CLI based and no GUI?
  113. -------------------------
  114. There are so many GUI based directory utilities, simply use Play16 as an
  115. external player. Consult the manual of your software package on how to
  116. do it. Application example: Assign "Play16 <filename> PRELOAD" to a button
  117. called "Jingle". Select the desired soundfile and press the Jingle-button.
  118. Wait for the appropriate moment and hit the return key - here comes the
  119. sound! Nice when audio dubbing your home videos or even on parties :-)
  120.  
  121.  
  122. How does it work? (technical info)
  123. ----------------------------------
  124. The standard Amiga audio device is limited to 8 bit / 28 kHz playbck
  125. when using DMA. With the introduction of ECS the 28 kHz DMA barrier
  126. was broken - but only if the current displaymode was one with double
  127. scan rate like productivity. The reason for this is the dependency
  128. between video and audio DMA. If you don't have ECS or if you simply
  129. don't want to switch to Productivity just to listen to your desired
  130. sound, Play16 can halve the sample rate during playback.
  131.  
  132. Another way to archieve high output rates is using IRQ. This works no
  133. matter what the displaymode is. I've been experimenting on that long
  134. before I started writing Play16 but there was so much jitter that my
  135. current downsampling method sounds much better.
  136.  
  137. To play back even long sounds, the popular method of double buffering
  138. is used. Alternatively, all data can be loaded into memory before
  139. playback. This is useful when playing short sounds or when loading
  140. the sound from floppy disk or slow CD ROM.
  141.  
  142. The 14 bit output is archieved by setting the first channel on each
  143. side to volume 64 and the second to volume 1. The louder channel then
  144. plays the upper 8 bits as usual while the other channel plays the
  145. 6 most significant bits of the low byte synchronously. Because timing
  146. is very crucial in this case it is nessecary to write directly to
  147. hardware registers instead of using the audio.device. This method may
  148. not work on future amiga models if there ever will be any... :-/
  149.  
  150. Unfortunately, Amiga's DACs are not perfectly linear. A significant
  151. increase in sound quality can be archieved by calibrating each
  152. MSB conversion step individually for your machine. Christian Buchner's
  153. CyberSound system supports this kind of calibration. Play16 can load
  154. the preferences file generated by Christian's calibration program.
  155.  
  156. The MPro output uses the maestix.library by Richard Körber. Have a look
  157. at the Maestix package available on AMINET for further details.
  158.  
  159. =========================== Section 3: Options ============================
  160.  
  161. What options are provided?
  162. --------------------------
  163. There are three ways to specify the options, which are:
  164.  
  165.  CLI:       In the commandline, using standard AmigaOS 2.x template
  166.  Workbench: In the icon, using standard Amiga Workbench tooltype entries
  167.  General:   By setting environment variables. This is not possible for
  168.             all options yet.
  169.  
  170. If you are not familiar with the AmigaOS 2.x commandline template, see
  171. the examples below and consult the AmigaOS manual for furhter information.
  172. The tooltype entries are identical to the keywords you can specify in the
  173. commandline. Also, the environment variables have the same names and reside
  174. in ENV:Play16. 
  175.  
  176. Basic options: (All options marked with (*) have corresponding env-vars.)
  177.  
  178. WINDOW/K(*) Specify output window for Workbench startup. This Keyword can
  179.             only be used in the ToolType entries of the Play16 icon itself.
  180.             If you don't set this, the hardcoded default will be used.
  181.  
  182. VERBOSITY/N Sets the level of verbosity.
  183.             0: Just display the banner and error messages
  184.             1: Print additional information about the sound file,
  185.                allocated memory, etc.
  186.             2: Progress information
  187.             3: Debugging information (may look a bit weird :)
  188.             Default is level 0.
  189.  
  190. FAST/S      Do NOT automatically switch to half sample rate if the
  191.             soundfile's rate exceeds 28 kHz. Use this option when
  192.             running your Amiga in Productivity or similar display
  193.             modes.
  194.  
  195. HIFI/S      Obsolete since V1.4 but still included for compatibility
  196.             reasons. See "OUTPUT/K".
  197.  
  198. OUTPUT/K(*) Set Play16's output device. Possible options are:
  199.  
  200.  Paula8      Standard 8 bit output through Amiga hardware. This option
  201.              is the default.
  202.  
  203.  Paula14     Turn on the 14 bit output. Watch out! This is a nasty routine
  204.              that writes directly to some hardware registers. I've done
  205.              everything I can to prevent Play16 from interfering with
  206.              other running tasks in this case but you'll never know...
  207.              Use it with care!
  208.  
  209.  Paula14c    Same as Paula14 but using the calibration preferences for
  210.              much better sound quality. See Section 2 for details.
  211.  
  212.  MPro        Use MacroSystem's Maestro Pro board for output. 44.1kHz and
  213.              48kHz sounds only. For 44.1kHz output a valid and stable
  214.              signal has to be present on the standard input. See the
  215.              manuals of Maestix and the MPro board for further info.
  216.  
  217.  8SVX        Do not play the sound but create an IFF-8SVX file containing
  218.              the data. Basically this is the output generated by <Paula8>
  219.              redirected into a file. The filename will be the input file's
  220.              name with "iff" appended.
  221.  
  222.              WARNING: All limitations of <Paula8> apply here as well,
  223.              which are:
  224.              - Every 16 bit sound will be cropped to 8 bits resulting in
  225.                loss of quality.
  226.              - If you DO NOT set the FAST keyword, the sample rate of the
  227.                output file will be limited to 28kHz and downsampled
  228.                automaticlly if nessecary.
  229.              I recommend to keep the original file if you have enough
  230.              space. If you don't you may be disappointed of your converted
  231.              8 bit sounds when you buy a better sound system!
  232.  
  233. FILTER/K(*) FILTER=ON  : Enable audio filter for playback
  234.             FILTER=OFF : Disable audio filter for playback
  235.             FILTER=AUTO: Turn filter on or off depending on sample rate
  236.             If you don't specify this keyword Play16 will leave the
  237.             hardware registers of the audiofilter completely untouched.
  238.  
  239. LOOPS/N     Determines the number of loops to be played.
  240.             Default is 1 loop. (Play the sound once.)
  241.             LOOPS=0 means infinite number of loops.
  242.  
  243.  
  244. Advanced Options:
  245.  
  246. SCREENMODE/N  Type of screen to open during playback. If you set
  247. (*)           SCREENMODE=0, a standard productivity screen will
  248.               be opened.
  249.  
  250. SINGLE/S      Use only one buffer rather then two and load all data into
  251.               memory before playback.
  252.  
  253. PRIORITY/N    Set Play16's task priority. May vary from -25 to 25, default
  254.               is 1.
  255.  
  256. BUFFER/N      Buffersize in samples. May vary from 32768 to 131072. The
  257.               amount of allocated memory also depends on whether the sound
  258.               is mono or stereo, 8 bit or 16 bit.
  259.               Default is 65536 samples, values are rounded to multiples of
  260.               32768.
  261.               Note that it is useless to modify this value when in single
  262.               buffer mode :)
  263.  
  264. PRELOAD/S     Load enough data into memory for immediate start of playback
  265.               at a keypress
  266.  
  267. RAW/S         Disable autodetect and tell Play16 what the actual format of
  268.               the sound data is.
  269.               However, if Play16 can't detect the filetype it will switch
  270.               to RAW mode automatically. If you don't want this to happen
  271.               you can specify STRICT:
  272.  
  273. STRICT/S      Play only files that are supported by the autodetect routine
  274.               Use this if you don't want to get scared by the sudden noisy
  275.               output when trying to play back other data than sound :-)
  276.  
  277. Examples:
  278.  
  279. a) Play16 music.wav
  280.     Simply play the file called music.wav once and directly from harddisk.
  281.  
  282. b) Play16 music.wav SINGLE
  283.     Same as above but load all data into memory before playback. Use this
  284.     when loading soundfiles from floppy disk.
  285.  
  286. c) Play16 music.wav SINGLE VERBOSITY=1
  287.     Same as b, but with additional information being printed out.
  288.  
  289. d) Play16 rhythm.wav LOOPS=10
  290.         Play the rhythm as a continuous loop, i.e. over and over again (10 times)
  291.  
  292. e) Play16 explosion.wav SINGLE PRELOAD
  293.     Load the complete explosion sound into memory, then wait for you to hit
  294.     <return> before playback.
  295.  
  296. f) Play16 MyFavouriteTune.wav FAST OUTPUT=8SVX
  297.     Convert the given file to IFF-8SVX without changing the sample rate.
  298.  
  299. g) Play16 MyFavouriteTune.wav OUTPUT=8SVX
  300.     Same as f but limit the sample rate of the converted file to 28kHz!
  301.  
  302. The following options tell Play16 what parameters to use when in RAW mode.
  303. This happens either if you set the RAW keyword or if Play16 could not
  304. identify the file and STRICT was _not_ set.
  305.  
  306.  
  307. Options when in RAW mode:
  308.  
  309. FREQ/N      Sampling frequency in Hz
  310. TRACKS/N    Number of tracks, 1 for mono, 2 for stereo
  311. BITS/N      Resolution in bits, may be 8 or 16
  312. HEADER/N    Length of header: This is the number of bytes to be skipped
  313.                               at the beginning of the file.
  314. UNSIGNED/S  Data is unsigned, not signed (only valid for  8 bit sounds)
  315. INTEL/S     Data is in Intel format      (only valid for 16 bit sounds)
  316. ULAW/S      Data is compressed using the uLaw compression scheme
  317.  
  318. The default settings are: 22050 Hz, mono, 8 bits, no header.
  319.  
  320.  
  321.  
  322. How do I use this RAW mode?
  323. ---------------------------
  324. Umm, err, difficult to explain, even harder to understand...
  325. Well, if you know the data format of the soundfile, simply set RAW, FREQ,
  326. TRACKS, BITS, UNSIGNED and INTEL accordingly. If you don't, the only
  327. way to find it out is by trial and error :) Here are some tips to make
  328. it a bit easier:
  329.  
  330. Don't set HEADER to an odd number. (Leave it at 0, first.)
  331. If you set BITS to 16 and hear nothing but noise, try to set INTEL.
  332. If you set BITS to 8 and the sound is distorted, try to set UNSIGNED.
  333. If the above does not help, try different combinations of BITS, INTEL
  334. and UNSIGNED.
  335.  
  336. If you manage to get a recognisable sound output which is either too
  337. fast or too slow, start experimenting on TRACKS and FREQ.
  338.  
  339. If you want to play known files and raw ones without changing the command
  340. line, simply specify all you know about the raw data and leave out the
  341. RAW and the STRICT keyword. If Play16 can indentify the file it will use
  342. its parameters. If the filetype is unknown your specified parameters will
  343. be used instead.
  344.  
  345.  
  346. Legal stuff
  347. -----------
  348. Play16 is copyrighted freeware. It may be distributed freely as long as
  349. no modifications are made to the executable and this document. A nominal
  350. fee may be asked to cover distribution costs.
  351.  
  352. Play16 may not be used for any commercial purposes or included with any
  353. commercial product without the written permission of the author.
  354.  
  355. No responsibilities are taken for damaged speakers, amplifiers, Amigas
  356. or any other components or data involved while using Play16.
  357.  
  358. Although I've done some beta testing I can't guarantee that Play16 will
  359. not crash! If you find any bugs, let me know.
  360.  
  361. It is NOT the fault of MacroSystem NOR does it represent the quality of
  362. their products if the MPro output or the maestix.library should fail.
  363.  
  364.  
  365. Miscellaneous
  366. -------------
  367. I don't claim Play16 to be fast. I've done some optimizing - but because
  368. the loader/converter module is a universial one, more data is actually
  369. being moved around different memory blocks than needed for playback.
  370. However, I've implemented separate optimized routines for 8 bit and
  371. for 14/16 bit.
  372.  
  373. * Please note that English is not my native language :)
  374.  
  375. I can be reached at...
  376.  
  377. Internet: wenzel@unixserv.rz.fh-hannover.de (preferred)
  378.           Thomas_Wenzel@aventure.fido.de
  379. Fido:     2:243/6050.28 or 2:241/1035.6
  380.           Mail routing _is_sometimes_ unreliable in FidoNet :-(
  381.  
  382. If you use this program, please send me a mail. I'd like to know how many
  383. people are interested in it at all.
  384.  
  385.  
  386. History
  387. -------
  388. V0.5ß   - Initial beta test release
  389.  
  390. V0.6ß   - Optimized the code a bit.
  391.  
  392. V0.7ß   - Fixed some severe bugs that caused Play16 to crash when trying
  393.           to load corrupted files.
  394.  
  395. V0.8ß   - Play16 can now be stopped by pressing ctrl-c during playback. The
  396.           buffer that is currently being played will be finished first.
  397.         - Automatic filter control depending on sample rate.
  398.  
  399. V0.9ß   - Added 'loop'-option. Sample can be played several times.
  400.         - All time consuming routines now in hand optimized assembler code.
  401.  
  402. V1.0ß   - Play16 now uses standard OS2.x commandline template.
  403.           Thanks to Kai for persuading me to do this :)
  404.  
  405. V1.0    - Done some minor bugfixes.
  406.  
  407. V1.1    - Oops! Play16 caused some Enforcer hits. Fixed that.
  408.           Thanks to Rod Schnell for reporting it.
  409.         - Added 'single'-option. Sound can be loaded completely into memory
  410.           before playing. No looping possible in this case yet!
  411.         - Playback time in minutes:seconds displayed if verbose >= 1
  412.         - uLaw decompression for WAVE-Files, using a decoding table
  413.           for maximum speed (didn't do much testing on it, hope it works!)
  414.         - MAUD filetype support (why do there have to be so many formats?)
  415.         - AIFF filetype support
  416.         - ctrl-c now stops playback immediately.
  417.           Thanks to Marc for some programming tips about that.
  418.  
  419. V1.2    - IFF-8SVX filetype support (only uncompressed files!)
  420.         - RAW data support: _Any_ data can be played
  421.         - Preload feature added
  422.         - Fixed a bug that caused illegal memory access (hopefully)
  423.           Thanks to Ignatios Souvatzis for reporting it.
  424.         - Improved chunk handling
  425.  
  426. V1.3    - 14 bit output (finally!)
  427.         - Any file Play16 can't recognise is considered raw data unless
  428.           you set the STRICT keyword
  429.         - Fixed a bug in WAV filetype length determination
  430.         - Advanced audiofilter control / original state will be restored
  431.           after playback
  432.         - More information about sound (AUTHOR or ANNO-Chunk) is being
  433.           printed out if VERBOSE>=1. However, Play16 will *not* search
  434.           the whole file for that string. If it doesn't come before the
  435.           sound data -- bad luck :-)
  436.  
  437. V1.3a   - Bugfix in chunk handling routine: Chunks with an odd length
  438.           were treated incorrectly. This bug accompanied all versions
  439.           of Play16, even V1.0. However, I decided to release a fix now
  440.           instead of letting you wait until V1.4 is finished.
  441.  
  442. V1.4    - Wildcard and multiple file support
  443.         - Environment variable support (partial)
  444.         - A filerequester will pop up if no filename is given
  445.         - Workbench support, including icon with tooltype entries
  446.         - Maestro Pro output, using Richard Körber's Maestix package
  447.         - Calibrated 14 bit output, using Christian Buchner's
  448.           CyberSound package
  449.         - IFF-8SVX file dump
  450.         - Creative VOC support (currently only 1st data block)
  451.           (This format crazy :-))
  452.         - Closing the output window now stops playback, too
  453.         - Looping now for single mode as well, LOOPS=0 won't cause
  454.           a severe crash any more
  455.           Thanks to Andy Church for reporting it.
  456.         - Open a screen during playback, e.g. productivity for fast DMA
  457.         - 68040 version included
  458.         - German docs
  459.  
  460. Things that were planned for 1.4 but have been postponed due to lack of time:
  461. ----------------------------------------------------------------------------
  462. - Fibonacci delta decompression for 8SVX samples
  463. - ALL/S keyword to include subdirectories
  464.  
  465. Future plans
  466. ------------
  467. - Better Creative-VOC support
  468. - ADPCM decompression (still having difficulties coding the algorhytm!
  469.                       If you have a working ADPCM4 decoder, please contact me)
  470. - some of the file types saved by Macintosh software (e.g. Sound-Designer)
  471. - Datatypes support
  472.  
  473. Known bugs
  474. ----------
  475. Some files have additional information stored AFTER the waveform data.
  476. Play16 does not recognise that and tries to play the data, resulting
  477. in a short 'blip' at the end of the sound. So far I've only encountered
  478. *some* WAVs that have this additional chunk at the end of the file.
  479.  
  480. Credits
  481. -------
  482. Thanks go to the following persons:
  483.  
  484. Kai Stuke         for many vital hints on C programming and the Amiga
  485.                   audio device and for beta testing this program.
  486.  
  487. Marc Führer       for doing some beta testing as well, giving valuable
  488.                   hints on optimizing the code and translating this document
  489.                   into German.
  490.  
  491. Clete Baker       for supplying the AIFF- and SDII specs.
  492.  
  493. Richard Körber    for writing the Maestix Library and making it freeware.
  494.  
  495. Christian Buchner for his research and ideas on how to improve the
  496.                   14bit output by calibrating the DACs individually.
  497.  
  498. And to all the people who wrote me!
  499.